******************************
** The early COVID-19 pandemic and democratic attitudes
** Noam Lupu and Elizabeth J. Zechmeister
** Replication Code
** Revised April 2021
******************************


*** Main results

* Table 1
vreverse m1, gen(presapp)
recode vb20 1=0 2=100 3/4=0, gen(vb20_inc)
recode jccov1 2=0, gen(jcc1_recode)
recode jccov2 2=0, gen(jcc2_recode)

svy: mean presapp, over(treat_covid)
	lincom A-B
svy: mean vb20_inc, over(treat_covid)
	lincom A-B
svy: mean jcc1_recode, over(treat_covid)
	lincom A-B
svy: mean jcc2_recode, over(treat_covid)
	lincom A-B

* Table 2
recode jc10 2=0, gen(jc10_recode)
recode jc13 2=0, gen(jc13_recode)
recode jc13covid 2=0, gen(jc13c_recode)

svy: mean ing4, over(treat_covid)
	lincom A-B
svy: mean jc10_recode, over(treat_covid)
	lincom A-B
svy: mean jc13_recode, over(treat_covid)
	lincom A-B
svy: mean jc13c_recode, over(treat_covid)
	lincom A-B

	
** Appendix analysis

* S1 Table
vreverse covid1, gen(covid1rev)
vreverse covid2a, gen(covid2arev)
vreverse covid2b, gen(covid2brev)
vreverse covid2c, gen(covid2crev)
vreverse covid3, gen(covid3rev)
recode covid4 1=1 2/77=0, gen(covid4inc)
recode covid6 2=0, gen(covid6r)
recode covid7 2=0, gen(covid7r)
recode covid8 2=0, gen(covid8r)
recode covid14 2=0, gen(covid14r)

svy: mean covid1rev, over(treat_covid)
	lincom A-B
svy: mean covid2arev, over(treat_covid)
	lincom A-B
svy: mean covid2brev, over(treat_covid)
	lincom A-B
svy: mean covid2crev, over(treat_covid)
	lincom A-B
svy: mean covid3rev, over(treat_covid)
	lincom A-B
svy: mean covid4inc, over(treat_covid)
	lincom A-B
svy: mean covid6r, over(treat_covid)
	lincom A-B
svy: mean covid7r, over(treat_covid)
	lincom A-B
svy: mean covid8r, over(treat_covid)
	lincom A-B
svy: mean covid14r, over(treat_covid)
	lincom A-B


* S2 Table
vreverse soct2, gen(soct2rev)
vreverse idio2, gen(idio2rev)
vreverse haiacs5, gen(haiacs5rev)
vreverse haiacs6, gen(haiacs6rev)
recode anesgi 2=0, gen(anesgir)
vreverse it1n, gen(it1nrev)
recode vic1ext 2=0, gen(vic1ext01)
vreverse aoj11, gen(aoj11rev)
vreverse haim6, gen(haim6rev)
vreverse exc7, gen(exc7rev)
vreverse exc7new, gen(exc7newrev)
vreverse essh1, gen(essh1rev)
recode hc3 2=0, gen(hc301)
vreverse sd6new2h, gen(sd6new2hrev)
vreverse pol1, gen(pol1rev)
vreverse hairig1, gen(hairig1rev)
vreverse hairig5, gen(hairig5rev)
recode wf1 2=0, gen(wf101)

svy: mean soct2rev, over(treat_covid)
	lincom A-B
svy: mean idio2rev, over(treat_covid)
	lincom A-B
svy: mean haiacs5rev, over(treat_covid)
	lincom A-B
svy: mean haiacs6rev, over(treat_covid)
	lincom A-B
svy: mean anesgir, over(treat_covid)
	lincom A-B
svy: mean it1nrev, over(treat_covid)
	lincom A-B
svy: mean vic1ext01, over(treat_covid)
	lincom A-B
svy: mean aoj11rev, over(treat_covid)
	lincom A-B
svy: mean ivol24, over(treat_covid)
	lincom A-B
svy: mean b1, over(treat_covid)
	lincom A-B
svy: mean b2, over(treat_covid)
	lincom A-B
svy: mean b3, over(treat_covid)
	lincom A-B
svy: mean b4, over(treat_covid)
	lincom A-B
svy: mean b6, over(treat_covid)
	lincom A-B
svy: mean bess1, over(treat_covid)
	lincom A-B
svy: mean haim6rev, over(treat_covid)
	lincom A-B
svy: mean exc7rev, over(treat_covid)
	lincom A-B
svy: mean exc7newrev, over(treat_covid)
	lincom A-B
svy: mean essh1rev, over(treat_covid)
	lincom A-B
svy: mean hc301, over(treat_covid)
	lincom A-B
svy: mean sd6new2hrev, over(treat_covid)
	lincom A-B
svy: mean pol1rev, over(treat_covid)
	lincom A-B
svy: mean hairig1rev, over(treat_covid)
	lincom A-B
svy: mean hairig5rev, over(treat_covid)
	lincom A-B
svy: mean wf101, over(treat_covid)
	lincom A-B

	
* S3 Table
reg treat_covid mujer i.edad i.edr i.region


* S4 Table
mean presapp, over(treat_covid)
	lincom A-B
mean vb20_inc, over(treat_covid)
	lincom A-B
mean jcc1_recode, over(treat_covid)
	lincom A-B
mean jcc2_recode, over(treat_covid)
	lincom A-B

	
* S5 Table
mean ing4, over(treat_covid)
	lincom A-B
mean jc10_recode, over(treat_covid)
	lincom A-B
mean jc13_recode, over(treat_covid)
	lincom A-B
mean jc13c_recode, over(treat_covid)
	lincom A-B

	
* S6 Table
svy: reg presapp i.treat_covid covid1rev mujer edad edr i.region
svy: logit vb20_inc i.treat_covid covid1rev mujer edad edr i.region
svy: logit jcc1 i.treat_covid covid1rev mujer edad edr i.region
svy: logit jcc2 i.treat_covid covid1rev mujer edad edr i.region


* S7 Table
svy: reg ing4 i.treat_covid covid1rev mujer edad edr i.region
svy: logit jc10_recode i.treat_covid covid1rev mujer edad edr i.region
svy: logit jc13_recode i.treat_covid covid1rev mujer edad edr i.region
svy: logit jc13c_recode i.treat_covid covid1rev mujer edad edr i.region


